//
//  DFConst.h
//  微商社区
//
//  Created by nahuo on 15/1/4.
//  Copyright (c) 2015年 nahuo. All rights reserved.
//

#ifndef DFConst_h
#define DFConst_h


#define ScreenSize [UIScreen mainScreen].bounds.size
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height

#define MainColor [UIColor colorWithRed:50/255.0 green:85/255.0 blue:180/255.0 alpha:1]

#define SharedApplication ((UIApplication*)[UIApplication sharedApplication])
#define SharedAppDelegate ((AppDelegate*)[[UIApplication sharedApplication] delegate])
#define SharedManagedObjectContext SharedAppDelegate.managedObjectContext

#define StoryboardInstantiate(storyboardName,viewControllerIdentifier) [[UIStoryboard storyboardWithName:storyboardName bundle:nil] instantiateViewControllerWithIdentifier:viewControllerIdentifier]

#define LoadNibFirst(name) [[[NSBundle mainBundle] loadNibNamed:name owner:nil options:nil] firstObject]

#define Color(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]


#define Push(class,pushctl) \
[class.view endEditing:YES]; \
[pushctl setHidesBottomBarWhenPushed:YES]; \
[class.navigationController pushViewController:pushctl animated:YES];

#define Present(class,pushCtl) [class presentViewController:pushCtl animated:YES completion:nil];
#define Dismiss(class) [class.view endEditing:YES];[class dismissViewControllerAnimated:YES completion:nil];
#define Back(class) [class.view endEditing:YES];[class.navigationController popViewControllerAnimated:YES];
#define BackTo(class,popctl) [class.view endEditing:YES];[class.navigationController popToViewController:popctl animated:YES];
#define BackRoot [class.view endEditing:YES];[self.navigationController popToRootViewControllerAnimated:YES];


// 2.日志输出宏定义
#ifdef DEBUG
// 调试状态
#define MyLog(...) NSLog(__VA_ARGS__)
#else
// 发布状态
#define MyLog(...)
#endif

#endif
